package com.rcl.himalaya_kotlin.base

import android.app.Application
import com.rcl.himalaya_kotlin.utils.LogUtil
import com.ximalaya.ting.android.opensdk.constants.DTransferConstants
import com.ximalaya.ting.android.opensdk.datatrasfer.CommonRequest

/*
 * class title: 
 * Author by RenChunLin, Email 18957806320@163.com, Date on 2020/9/2.
 * PS: Not easy to write code, please indicate.
 */
class BaseApplication : Application() {
    override fun onCreate() {
        super.onCreate()

        /**
         * 喜马拉雅SDK——key的配置
         */
        val mXimalaya = CommonRequest.getInstanse()
        if (DTransferConstants.isRelease) {
            val mAppSecret = "afe063d2e6df361bc9f1fb8bb8210d67"
            mXimalaya.setAppkey("af1d317b871e0e7e2ce45872caa34d9a")
            mXimalaya.setPackid("com.humaxdigital.automotive.ximalaya")
            mXimalaya.init(this, mAppSecret)
        } else {
            val mAppSecret = "0a09d7093bff3d4947a5c4da0125972e"
            mXimalaya.setAppkey("f4d8f65918d9878e1702d49a8cdf0183")
            mXimalaya.setPackid("com.ximalaya.qunfeng")
            mXimalaya.init(this, mAppSecret)
        }

        /**
         * Log日志工具类的配置
         */
        LogUtil.init(this.packageName, false)
    }
}